<!doctype html>

<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>gaugetheme.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>

<div class="clear"></div>

<h2><a href="closure_goog_ui_gaugetheme.js.html">gaugetheme.js</a></h2>

<pre class="prettyprint lang-js">
<a name="line1"></a>// Copyright 2007 The Closure Library Authors. All Rights Reserved.
<a name="line2"></a>//
<a name="line3"></a>// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
<a name="line4"></a>// you may not use this file except in compliance with the License.
<a name="line5"></a>// You may obtain a copy of the License at
<a name="line6"></a>//
<a name="line7"></a>//      http://www.apache.org/licenses/LICENSE-2.0
<a name="line8"></a>//
<a name="line9"></a>// Unless required by applicable law or agreed to in writing, software
<a name="line10"></a>// distributed under the License is distributed on an &quot;AS-IS&quot; BASIS,
<a name="line11"></a>// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<a name="line12"></a>// See the License for the specific language governing permissions and
<a name="line13"></a>// limitations under the License.
<a name="line14"></a>
<a name="line15"></a>
<a name="line16"></a>/**
<a name="line17"></a> * @fileoverview The color theme used by a gauge (goog.ui.Guage).
<a name="line18"></a> */
<a name="line19"></a>
<a name="line20"></a>
<a name="line21"></a>goog.provide(&#39;goog.ui.GaugeTheme&#39;);
<a name="line22"></a>
<a name="line23"></a>
<a name="line24"></a>goog.require(&#39;goog.graphics.LinearGradient&#39;);
<a name="line25"></a>goog.require(&#39;goog.graphics.SolidFill&#39;);
<a name="line26"></a>goog.require(&#39;goog.graphics.Stroke&#39;);
<a name="line27"></a>
<a name="line28"></a>
<a name="line29"></a>
<a name="line30"></a>/**
<a name="line31"></a> * A class for the default color theme for a Gauge.
<a name="line32"></a> * Users can extend this class to provide a custom color theme, and apply the
<a name="line33"></a> * custom color theme by calling  {@link goog.ui.Gauge#setTheme}.
<a name="line34"></a> * @constructor
<a name="line35"></a> */
<a name="line36"></a>goog.ui.GaugeTheme = function() {
<a name="line37"></a>};
<a name="line38"></a>
<a name="line39"></a>
<a name="line40"></a>/**
<a name="line41"></a> * Returns the stroke for the external border of the gauge.
<a name="line42"></a> * @return {goog.graphics.Stroke} The stroke to use.
<a name="line43"></a> */
<a name="line44"></a>goog.ui.GaugeTheme.prototype.getExternalBorderStroke = function() {
<a name="line45"></a>  return new goog.graphics.Stroke(1, &#39;#333333&#39;);
<a name="line46"></a>};
<a name="line47"></a>
<a name="line48"></a>
<a name="line49"></a>/**
<a name="line50"></a> * Returns the fill for the external border of the gauge.
<a name="line51"></a> * @param {number} cx X coordinate of the center of the gauge.
<a name="line52"></a> * @param {number} cy Y coordinate of the center of the gauge.
<a name="line53"></a> * @param {number} r Radius of the gauge.
<a name="line54"></a> * @return {goog.graphics.Fill} The fill to use.
<a name="line55"></a> */
<a name="line56"></a>goog.ui.GaugeTheme.prototype.getExternalBorderFill = function(cx, cy, r) {
<a name="line57"></a>  return new goog.graphics.LinearGradient(cx + r, cy - r, cx - r, cy + r,
<a name="line58"></a>      &#39;#f7f7f7&#39;, &#39;#cccccc&#39;);
<a name="line59"></a>};
<a name="line60"></a>
<a name="line61"></a>
<a name="line62"></a>/**
<a name="line63"></a> * Returns the stroke for the internal border of the gauge.
<a name="line64"></a> * @return {goog.graphics.Stroke} The stroke to use.
<a name="line65"></a> */
<a name="line66"></a>goog.ui.GaugeTheme.prototype.getInternalBorderStroke = function() {
<a name="line67"></a>  return new goog.graphics.Stroke(2, &#39;#e0e0e0&#39;);
<a name="line68"></a>};
<a name="line69"></a>
<a name="line70"></a>
<a name="line71"></a>/**
<a name="line72"></a> * Returns the fill for the internal border of the gauge.
<a name="line73"></a> * @param {number} cx X coordinate of the center of the gauge.
<a name="line74"></a> * @param {number} cy Y coordinate of the center of the gauge.
<a name="line75"></a> * @param {number} r Radius of the gauge.
<a name="line76"></a> * @return {goog.graphics.Fill} The fill to use.
<a name="line77"></a> */
<a name="line78"></a>goog.ui.GaugeTheme.prototype.getInternalBorderFill = function(cx, cy, r) {
<a name="line79"></a>  return new goog.graphics.SolidFill(&#39;#f7f7f7&#39;);
<a name="line80"></a>};
<a name="line81"></a>
<a name="line82"></a>
<a name="line83"></a>/**
<a name="line84"></a> * Returns the stroke for the major ticks of the gauge.
<a name="line85"></a> * @return {goog.graphics.Stroke} The stroke to use.
<a name="line86"></a> */
<a name="line87"></a>goog.ui.GaugeTheme.prototype.getMajorTickStroke = function() {
<a name="line88"></a>  return new goog.graphics.Stroke(2, &#39;#333333&#39;);
<a name="line89"></a>};
<a name="line90"></a>
<a name="line91"></a>
<a name="line92"></a>/**
<a name="line93"></a> * Returns the stroke for the minor ticks of the gauge.
<a name="line94"></a> * @return {goog.graphics.Stroke} The stroke to use.
<a name="line95"></a> */
<a name="line96"></a>goog.ui.GaugeTheme.prototype.getMinorTickStroke = function() {
<a name="line97"></a>  return new goog.graphics.Stroke(1, &#39;#666666&#39;);
<a name="line98"></a>};
<a name="line99"></a>
<a name="line100"></a>
<a name="line101"></a>/**
<a name="line102"></a> * Returns the stroke for the hinge at the center of the gauge.
<a name="line103"></a> * @return {goog.graphics.Stroke} The stroke to use.
<a name="line104"></a> */
<a name="line105"></a>goog.ui.GaugeTheme.prototype.getHingeStroke = function() {
<a name="line106"></a>  return new goog.graphics.Stroke(1, &#39;#666666&#39;);
<a name="line107"></a>};
<a name="line108"></a>
<a name="line109"></a>
<a name="line110"></a>/**
<a name="line111"></a> * Returns the fill for the hinge at the center of the gauge.
<a name="line112"></a> * @param {number} cx  X coordinate of the center of the gauge.
<a name="line113"></a> * @param {number} cy  Y coordinate of the center of the gauge.
<a name="line114"></a> * @param {number} r  Radius of the hinge.
<a name="line115"></a> * @return {goog.graphics.Fill} The fill to use.
<a name="line116"></a> */
<a name="line117"></a>goog.ui.GaugeTheme.prototype.getHingeFill = function(cx, cy, r) {
<a name="line118"></a>  return new goog.graphics.LinearGradient(cx + r, cy - r, cx - r, cy + r,
<a name="line119"></a>      &#39;#4684ee&#39;, &#39;#3776d6&#39;);
<a name="line120"></a>};
<a name="line121"></a>
<a name="line122"></a>
<a name="line123"></a>/**
<a name="line124"></a> * Returns the stroke for the gauge needle.
<a name="line125"></a> * @return {goog.graphics.Stroke} The stroke to use.
<a name="line126"></a> */
<a name="line127"></a>goog.ui.GaugeTheme.prototype.getNeedleStroke = function() {
<a name="line128"></a>  return new goog.graphics.Stroke(1, &#39;#c63310&#39;);
<a name="line129"></a>};
<a name="line130"></a>
<a name="line131"></a>
<a name="line132"></a>/**
<a name="line133"></a> * Returns the fill for the hinge at the center of the gauge.
<a name="line134"></a> * @param {number} cx X coordinate of the center of the gauge.
<a name="line135"></a> * @param {number} cy Y coordinate of the center of the gauge.
<a name="line136"></a> * @param {number} r Radius of the gauge.
<a name="line137"></a> * @return {goog.graphics.Fill} The fill to use.
<a name="line138"></a> */
<a name="line139"></a>goog.ui.GaugeTheme.prototype.getNeedleFill = function(cx, cy, r) {
<a name="line140"></a>  // Make needle a bit transparent so that text underneeth is still visible.
<a name="line141"></a>  return new goog.graphics.SolidFill(&#39;#dc3912&#39;, 0.7);
<a name="line142"></a>};
<a name="line143"></a>
<a name="line144"></a>
<a name="line145"></a>/**
<a name="line146"></a> * Returns the color for the gauge title.
<a name="line147"></a> * @return {string} The color to use.
<a name="line148"></a> */
<a name="line149"></a>goog.ui.GaugeTheme.prototype.getTitleColor = function() {
<a name="line150"></a>    return &#39;#333333&#39;;
<a name="line151"></a>};
<a name="line152"></a>
<a name="line153"></a>
<a name="line154"></a>/**
<a name="line155"></a> * Returns the color for the gauge value.
<a name="line156"></a> * @return {string} The color to use.
<a name="line157"></a> */
<a name="line158"></a>goog.ui.GaugeTheme.prototype.getValueColor = function() {
<a name="line159"></a>    return &#39;black&#39;;
<a name="line160"></a>};
<a name="line161"></a>
<a name="line162"></a>
<a name="line163"></a>/**
<a name="line164"></a> * Returns the color for the labels (formatted values) of tick marks.
<a name="line165"></a> * @return {string} The color to use.
<a name="line166"></a> */
<a name="line167"></a>goog.ui.GaugeTheme.prototype.getTickLabelColor = function() {
<a name="line168"></a>    return &#39;#333333&#39;;
<a name="line169"></a>};
</pre>


</body>
</html>
